<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Auth extends CI_Controller {

	function __construct()
	{
		parent::__construct();
		//$this->load->database();
		$this->load->model('helloworld_model');
		
		$this->load->helper('url');
		$this->load->config('zs_config');
	}
	
	public function index(){
	   	//$this->load->view('admin/login');
	   	$this->login();
	}
	
	function login() {
		
		$this->load->library('form_validation');
		$this->form_validation->set_rules('inputPassword', '본문', 'required');
		if ($this->form_validation->run() == FALSE)
		{
			echo validation_errors();
			$this->load->view('admin/login');
		}
		else
		{
			$this->load->helper('url');
			//echo site_url('admin/dashboard');
			redirect('admin/dashboard');
		}
		
		
	}

	
}

